/*
* ============================================================================
*  Name     : CV8LogCallContainer from V8LogCallContainer.h
*  Part of  : v8Log
*  Created  : 2006-4-7 by key
*  Description:
*     Declares container control for application.
*  Version  :
*  Copyright: http:www.3gv8.com
* ============================================================================
*/

#ifndef V8LOGCALLCONTAINER_H
#define V8LOGCALLCONTAINER_H

// INCLUDES
#include <coecntrl.h>
 
#include <eiklbo.h>  		// MEikListBoxObserver
#include <badesca.h> 		// CDescArray


#include "TLogParse.h"

// FORWARD DECLARATIONS
class CAknDoubleStyleListBox;
class TLogParse;
class CV8LogAppUi;
// CLASS DECLARATION

/**
*  CV8LogCallContainer  container control class.
*  
*/

class CV8LogCallContainer : public CCoeControl, 
							public MCoeControlObserver,
							public	MEikListBoxObserver
    {

    public: // Constructors and destructor
        
        /**
        * EPOC default constructor.
        * @param aRect Frame rectangle for container.
        */
        void ConstructL(const TRect& aRect,CV8LogAppUi* aUI);

        /**
        * Destructor.
        */
        ~CV8LogCallContainer();

    public: // New functions

    public: // Functions from base classes
	    TInt ListBoxItemCount();
	    void ResetEventList();
	    void HandleListBoxEventL(CEikListBox* aListBox, TListBoxEvent aListBoxEvent);

    private: // Functions from base classes

       /**
        * From CoeControl,SizeChanged.
        */
        void SizeChanged();

       /**
        * From CoeControl,CountComponentControls.
        */
        TInt CountComponentControls() const;

       /**
        * From CCoeControl,ComponentControl.
        */
        CCoeControl* ComponentControl(TInt aIndex) const;

       /**
        * From CCoeControl,Draw.
        */
        void Draw(const TRect& aRect) const;

		/**
		* From MCoeControlObserver
		* Acts upon changes in the hosted control's state. 
		*
		* @param	aControl	The control changing its state
		* @param	aEventType	The type of control event 
		*/
        void HandleControlEventL(CCoeControl* aControl,TCoeEvent aEventType);
        
    private: //data
	    CDesCArray* GetListBoxModel();
	    TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent,TEventCode aType);

	//CAknColumnListBox* iEventsListBox; // events list
	CAknDoubleStyleListBox* iEventsListBox;
	public:
		void ShowCallEventDetailsL();
		void ShowCallLogList(TSort aSort);
		CV8LogAppUi* ui;
		CLogParse*  iLogParse;
   };

#endif

// End of File
